package com.liuyucheng.designpattern.适配器模式;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;

/**
 * 客户端类
 * 如电脑
 */
public class Computer {
    public void net(NetToUSB adapter){
        //上网的具体实现,找一个转接头
        adapter.handleRequest();
    }


    public static void main(String[] args) throws FileNotFoundException {
        Computer pc = new Computer();//电脑
        Adaptee adaptee = new Adaptee();//网线
        Adapter adapter = new Adapter();//转接器

        pc.net(adapter);



        //
        Adapter2 adapter2 = new Adapter2(adaptee);
        pc.net(adapter2);




        //例子,将字节流转换为字节流
        new InputStreamReader(new FileInputStream(""));
    }
}
